package com.googlecode.flealancemarket.tapestry.util;

import java.util.Map;

import org.apache.tapestry.OptionModel;

/**
 * General purpose option model for domain classes implemented as JavaBeans
 * It needs a reference to an instance of its appropriate class - bean,
 * This instance will be used to create a model item
 * 
 * @author Goran Jovic <goranjovic@gmail.com/>
 * @since Sep 16, 2008
 **/
public class BeanOptionModel<T> implements OptionModel {
	
	private T bean;

	public BeanOptionModel(T bean) {
		this.bean=bean;
	}

	public Map<String, String> getAttributes() {
		return null;
	}

	public String getLabel() {
		return bean.toString();
	}

	public Object getValue() {
		return bean;
	}

	public boolean isDisabled() {
		return false;
	}

}
